package org.keyroy.map_editor.ui.listeners;

import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;

import org.keyroy.map_editor.map.m.Point;

public class PointerListener implements MouseListener, MouseMotionListener, MouseWheelListener {
	public Point point = new Point();

	@Override
	public void mouseClicked(final MouseEvent e) {

	}

	@Override
	public void mouseEntered(final MouseEvent e) {

	}

	@Override
	public void mouseExited(final MouseEvent e) {

	}

	@Override
	public void mousePressed(final MouseEvent e) {
		point.setLocation(e.getX(), e.getY());
	}

	@Override
	public void mouseReleased(final MouseEvent e) {

	}

	@Override
	public void mouseDragged(final MouseEvent e) {
		point.setLocation(e.getX(), e.getY());
	}

	@Override
	public void mouseMoved(final MouseEvent e) {

	}

	public static final boolean isLeft(final MouseEvent e) {
		return (e.getModifiers() & InputEvent.BUTTON1_MASK) != 0;
	}

	public static final boolean isRight(final MouseEvent e) {
		return (e.getModifiers() & InputEvent.BUTTON3_MASK) != 0;
	}

	public static final boolean isCenter(final MouseEvent e) {
		return (e.getModifiers() & InputEvent.BUTTON2_MASK) != 0;
	}

	@Override
	public void mouseWheelMoved(MouseWheelEvent e) {
	}
}